<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6.1</title>
</head>
<body>
    <div>
        <a href="demo62.html">6.2</a>
    </div>
    <button>点击我后退到6</button>
    <button>点击我前进到6.2</button>
    <button>点击我前进到6.3</button>
    <script>
        var btnEle1 = document.querySelector("button");
        btnEle1.onclick = function () {
            window.history.back();
        } 
        var btnEle2 = document.querySelectorAll("button")[1];
        btnEle2.onclick = function () {
            window.history.forward();
        } 
        var btnEle3 = document.querySelectorAll("button")[2];
        btnEle3.onclick = function () {
            window.history.go(2);
        } 
    </script>
</body>
</html>